<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_users
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 * @since		1.6
 */

defined('_JEXEC') or die;

?>
<fieldset id="users-profile-detail">
	<dl>
		<dt>
			<?php echo JText::_('COM_USERS_PROFILE_LASTNAME_LABEL'); ?>
			<span class="optional"><?php echo JText::_('COM_USERS_OPTIONAL'); ?>
			</span>
		</dt>
		<dd>
			<input type="text" size="30" name="last_name"
				value=<?php echo $this->detail->last_name;?> />
		</dd>

		<dt>
			<?php echo JText::_('COM_USERS_PROFILE_FIRSTNAME_LABEL'); ?>
			<span class="optional"><?php echo JText::_('COM_USERS_OPTIONAL'); ?>
			</span>
		</dt>
		<dd>
			<input type="text" size="30" name="first_name"
				value=<?php echo $this->detail->first_name; ?> />
		</dd>

		<dt>
			<?php echo JText::_('COM_USERS_PROFILE_PHONE_LABEL'); ?>
			<span class="optional"><?php echo JText::_('COM_USERS_OPTIONAL'); ?>
			</span>
		</dt>
		<dd>
			<input type="text" size="30" name="phone_number"
				value=<?php echo $this->detail->phone_number; ?> />
		</dd>

		<dt>
			<?php echo JText::_('COM_USERS_PROFILE_BIRTHDAY_LABEL'); ?>
			<span class="optional"><?php echo JText::_('COM_USERS_OPTIONAL'); ?>
			</span>
		</dt>
		<dd>
			<input type="text" size="30" name="birth_day"
				value=<?php if($this->detail->birthday != null) echo  $this->detail->birthday; ?> />
		</dd>

		<dt>
			<?php echo JText::_('COM_USERS_PROFILE_ADDRESS_LABEL'); ?>
			<span class="optional"><?php echo JText::_('COM_USERS_OPTIONAL'); ?>
			</span>
		</dt>
		<dd>
			<input type="text" size="30" name="address"
				value=<?php echo  $this->detail->address; ?> />
		</dd>

		<dt>
			<?php echo JText::_('COM_USERS_PROFILE_SEX_LABEL'); ?>
			<span class="optional"><?php echo JText::_('COM_USERS_OPTIONAL'); ?>
			</span>
		</dt>
		<dd>
			<?php if ($this->detail->sex == 1){?>
			<input type="radio" name="sex" value="1" checked="checked" id="sex" /><label>Nam</label>
			<input type="radio" name="sex" value="0" id="sex" /><label>Nữ</label>
			<?php }
			if($this->detail->sex == 0 && $this->detail->sex != null) {?>
			<input type="radio" name="sex" value="1" id="sex" /><label>Nam</label> <input
				type="radio" name="sex" value="0" checked="checked" id="sex" /><label>Nữ</label>

			<?php } ?>

			
		<dt>
			<?php echo JText::_('COM_USERS_PROFILE_COUNTRY_LABEL'); ?>
			<span class="optional"><?php echo JText::_('COM_USERS_OPTIONAL'); ?>
			</span>
		</dt>
		<dd>
			<select name ="country">
				<?php
				$db =&JFactory::getDbo();
				$sql = 'select * from aas_country ';
				$db->setQuery($sql);
				$db=$db->loadObjectlist();
				?>
				<?php 
				foreach ($db as $ct){
			if($ct->id == $this->detail->country_id){?>
				<option selected="selected" value=<?php echo $ct->id;?>>
					<?php echo $ct->name; ?>
				</option>
				<?php 
			} else { ?>
				<option value=<?php echo $ct->id;?>>
					<?php echo $ct->name; ?>
				</option>
				<?php }?>
				<?php }?>
			</select>
		</dd>
	</dl>

</fieldset>
